/*
 * @Author: zgz
 * @Date: 2019-09-06 16:41:01
 * @LastEditTime: 2022-02-25 11:22:33
 * @LastEditors: zgz
 * @Description: file conten
 */
import { HttpClientService } from '../../common/services/httpClient/http';
import { Injectable } from '@angular/core';

@Injectable()
export class CheckMenuService {

   constructor(private http: HttpClientService) { }

   defaultDate() {
      let o = {
         one_bgjd: [
            {
               type: "input",
               name: "service_name",
               label: "专属客服",
               value: "张三"
            },
            {
               type: "input",
               name: "customer_name", label: "客户姓名",
               value: "李四"
            },
            {
               type: "input",
               name: "customer_age", label: "客户年龄",
               value: "29"
            },
            {
               type: "input",
               name: "customer_six", label: "客户性别",
               value: "女"
            },
            {
               type: "input",
               name: "customer_phone", label: "客户联系电话",
               value: "151****8888"
            },
            {
               type: "input",
               name: "doctor_name", label: "解读医生",
               value: "王二主任"
            },
            {
               type: "input",
               name: "check_number", label: "检查登记号",
               value: "DJ8888888"
            },
            {
               type: "inputDate",
               name: "check_date", label: "检查日期",
               value: "2021-11-13",
               onChange: (result: any, item: any) => {
                  setTimeout(() => {
                     item.value = this.dateFormate(result, 'yyyy-MM-dd');
                  }, 300);
               }
            },
         ],
         two_import: {
            _one: [],
            _two: [
               {
                  type: "input",
                  name: "问题",
                  value: "HPV33 型偏高",
                  _id: "dsafsadfsafasf"
               },
               {
                  type: "input",
                  name: "问题",
                  value: "碳 13 阳性",
                  _id: "dsafsadf123safasf"
               },
               {
                  type: "input",
                  name: "问题",
                  value: "巧克力囊肿",
                  _id: "dsaf213sdfasf"
               },
               {
                  type: "input",
                  name: "问题",
                  value: "CT 胸部低剂量扫描：双肺多发实性/磨玻璃微/小结节",
                  _id: "dsaf213s12312afadfasf"
               },
            ],
            _three: [
               {
                  type: "input",
                  name: "问题",
                  value: "甘油三脂测定偏高",
                  _id: "asdf2312312"
               },
               {
                  type: "input",
                  name: "问题",
                  value: "尿液干化分析：白细胞+- 3、L5-S1 椎间盘轻度突出（侧旁型）",
                  _id: "asdf23123asdfad12"
               },
               {
                  type: "input",
                  name: "问题",
                  value: "体重偏低",
                  _id: "asdf2323423412312"
               },

            ]
         },
         three_check: [
            [
               {
                  type: "input",
                  name: "检查项目名称",
                  value: "胃镜检查",
                  _id: "asdf2323423412124312"
               },
               {
                  type: "input",
                  name: "进一步检查因素",
                  value: "碳 13 阳性",
                  _id: "asdf23234234asdf12312"
               }
            ]
         ],
         free_suggest: [
            {
               type: "input",
               name: "建议",
               value: "HPV33 型偏高：建议去妇科就诊，应用抗病毒药物",
               _id: "asdf23234234asdf12asdfas312"

            },
            {
               type: "input",
               name: "建议",
               value: "巧克力囊肿：建议中医科会诊，保守治疗调理并改善生活作息",
               _id: "asdf2321sa34234asdf12312"

            },
         ],
         four_direction: [
            [
               {
                  type: "input",
                  name: "药品名称",
                  value: "奥美拉唑肠溶片",
                  _id: "asdf2321sa34234asdf12adfa312"

               },
               {
                  type: "input",
                  name: "药品剂量",
                  value: "一次1片,一日2次",
                  _id: "asdf2321sa34234asdf11232312"

               },
               {
                  type: "input",
                  name: "服用方式",
                  value: "口服,不可咀嚼",
                  _id: "asdf2321sa34234asdf12adfaf312"

               }
            ]
         ],
         sex_sportfoot: [
            {
               type: "input",
               name: "健康建议",
               value: "多吃蔬菜水果和薯类",
               _id: "asdf2321sa3q4234asdf12adfaf312"

            },
            {
               type: "input",
               name: "健康建议",
               value: "每天吃奶类，大豆及其制品",
               _id: "asdf2321sa34r234asdf12adfaf312"

            },
            {
               type: "input",
               name: "健康建议",
               value: "常吃鱼、禽、蛋和瘦肉",
               _id: "asdf232w1sa34234asdf12adfaf312"

            },
            {
               type: "input",
               name: "健康建议",
               value: "适量减少烹调油用量，吃清淡少盐膳食",
               _id: "asdf2321qsa34234asdf12adfaf312"

            },
            {
               type: "input",
               name: "健康建议",
               value: "三餐分配要合理，零食要适当",
               _id: "asdf2321sa34234asdf12qadfaf312"

            },
            {
               type: "input",
               name: "健康建议",
               value: "每天食不过量，每天保证 30 分钟运动量",
               _id: "asdf2321sa34234asdf12adadffaf312"

            },
            {
               type: "input",
               name: "健康建议",
               value: "每天足量饮水",
               _id: "asdf2321sa34234asdf12adfaaff312"

            },
         ],
         seven_review: [
            [
               {
                  type: "input",
                  name: "复查内容",
                  value: "液基细胞学薄片检测",
                  _id: "asdf2321sa34234asdf12adfaafaf312"

               },
               {
                  type: "inputDate",
                  name: "复查时间",
                  value: "2021-05-12",
                  onChange: (result: any, item: any) => {
                     setTimeout(() => {
                        item.value = this.dateFormate(result, 'yyyy-MM-dd');
                     }, 300);
                  },
                  _id: "asdf2321sa34123s234asdf12adfaaff312"

               },
               {
                  type: "input",
                  name: "复查周期",
                  value: "6 个月",
                  _id: "asdf2321sa34234asdf12adfaaff31afaf2"

               },
               {
                  type: "input",
                  name: "备注",
                  value: "HPV33 型偏高",
                  _id: "asdf2321sa34234asdf12adadfa1faaff312"

               }
            ]
         ],
         eight_contrast:{
            
            checkdate: "2021-05-12",
            checkList: [
               [
                  {
                     type: "input",
                     name: "项目名称",
                     value: "白细胞",
                     _id: "asdf2321sa34234asdfasdf12adadfa1faaff312"

                  },
                  {
                     type: "input",
                     name: "本次结果",
                     value: "5.6",
                     _id: "asdf2321sa34adf234asdf12adadfa1faaff312"

                  },
                  {
                     type: "input",
                     name: "上次结果",
                     value: "12",
                     _id: "asdf2321sa34234asdf12adadfa1faaff31122"

                  },
                  {
                     type: "input",
                     name: "参考范围",
                     value: "3.6-9.6",
                     _id: "asdf2321sa12334234asdf12adadfa1faaff312"

                  },
                  {
                     type: "input",
                     name: "单位",
                     value: "10＾9/L",
                     _id: "asdf2321sa34234asdf12adadsfafa1faaff312"

                  }
               ]
            ]
         },
         nine_conclusion:[
            {
               checkdate:"2021-05-12",
               conclusion:[
                  {
                     type: "input",
                     name: "结论",
                     value: "右肺上叶尖段磨玻璃小结节,同前,考虑慢性炎性灶",
                     _id: "dsafsadfsafasf"
                  },
               ]
            }
         ]


      };
      return o;
   }

   dateFormate(value: any, fmt: any) {

      //时间为空
      if (value == null || value == '') {
         return value;
      } else {

         value = new Date(value);

         let o: any = {
            "M+": value.getMonth() + 1, //月份 
            "d+": value.getDate(), //日 
            "h+": value.getHours(), //小时 
            "m+": value.getMinutes(), //分 
            "s+": value.getSeconds(), //秒 
            "q+": Math.floor((value.getMonth() + 3) / 3), //季度 
            "S": value.getMilliseconds() //毫秒 
         };

         if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (value.getFullYear() + "").substr(4 - RegExp.$1.length));
         for (var k in o)
            if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));

         return fmt;
      }



   }


}